package com.wulin.learning.设计模式.外观模式;

/**
 * @author liuwulin
 * @date 2023/10/18-13:16
 * @DESC
 */
public class EncryptFacadeNew extends AbstractEncryptFacade {
    private FileReader reader;
    private CipherMachineNew cipher;
    private FileWriter writer;

    public EncryptFacadeNew() {
        reader = new FileReader();
        cipher = new CipherMachineNew();
        writer = new FileWriter();
    }

    @Override
    public void FileEncrypt(String fileNameSrc, String fileNameDes) {
        String plainStr = reader.Read(fileNameSrc);
        String encryptStr = cipher.Encrypt(plainStr);
        writer.Write(encryptStr, fileNameDes);
    }
}
